package com.manager.devicemanager.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.manager.devicemanager.entity.DeviceUser;
import com.manager.devicemanager.mapper.DeviceUserMapper;
import com.manager.devicemanager.service.IDeviceUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.manager.devicemanager.vo.DeviceUserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 设备用户关联表 服务实现类
 * </p>
 *
 * @author wpf
 * @since 2025-05-27
 */
@Service
public class DeviceUserServiceImpl extends ServiceImpl<DeviceUserMapper, DeviceUser> implements IDeviceUserService {


    @Autowired
    private DeviceUserMapper deviceUserMapper;

    @Override
    public List<DeviceUserVO> getDeviceUserInfo(String deviceid) {
        return deviceUserMapper.getDeviceUserInfo(deviceid);
    }

    @Override
    public List<DeviceUser> getDeviceUserInfoByUserid(String userid) {
        QueryWrapper<DeviceUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("userid", userid);
        return deviceUserMapper.selectList(queryWrapper);
    }

}
